<template>
    <div class="write">
        <WriteItem 
            :listData="item" 
            v-for="(item, index) in list" 
            :key="index"
            :starType="3"
            @click.native="toDetail(item)"
            @to-detail="toDetail"
        />
    </div>
</template>

<script>
    import WriteItem from '../components/write-item.vue'

    export default {
        components: {WriteItem},
        props: {
            list: {
                type: Array,
                default: []
            }
        },
        methods: {
            toDetail({id}, scroll = ''){
                uni.navigateTo({
                    url: `/pages/memory/detail/index?type=3&id=${id}&scroll=${scroll}`
                })
            },
        },
    }
</script>

<style lang="scss" rel="stylesheet/scss" scoped>
@function toRem($rpx){  //$rpx为需要转换的字号
    @return #{$rpx * 100 / 750 / 4}rem; 
}
.write{
    margin: 0 toRem(30) toRem(20);
}

</style>

